package arch.coal.ellipse.security.main;

import java.io.FileInputStream;
import java.util.Properties;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

import arch.coal.ellipse.security.dev.DataRetrieve;
import arch.coal.ellipse.security.dev.ProcessResultsOfMSF034;
import arch.coal.ellipse.security.tables.TableMSF034;
import arch.coal.ellipse.security.utils.StaticInfo;
;

public class Audit_Main {

	   // Define a static logger variable so that it references the
	   // Logger instance named "MyApp".
	   static Logger logger = Logger.getLogger(Test_Main.class);
	   
	   public static Properties properties = null;
	   
	   
	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		   
		PropertyConfigurator.configure("log4j.properties");
		logger.debug("- Now in Test_Main.main()");
		
		properties = new Properties();
		
		if (args != null && args.length > 0) {
			properties.load( new FileInputStream(args[0]) );
			StaticInfo.setProperties(properties);
			logger.debug( " now loading properties ...");
		}
		
		logger.debug("Now trying with new and improved classes");
		TableMSF034 msf034 = new TableMSF034();
		//msf034.addWhereClause("WHERE user_id like ('%GRANT%')");
		msf034.addWhereClause("WHERE seqnce_no in (209241,209240,427613,304162,303767,382758)");
		//msf034.addWhereClause("WHERE seqnce_no in (303767)");
		DataRetrieve getData2 = new DataRetrieve(msf034, properties);
		TableMSF034 _msf034 = (TableMSF034) getData2.getData();
		logger.debug("MSF034 contains [" + _msf034.getDataList().size() + "] items.");
		

		new ProcessResultsOfMSF034(_msf034);
		
		logger.debug("LEAVING \n ===================================== \n");
	}
}
